package top.wettis.chat.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.util.Strings;
import org.springframework.stereotype.Service;
import top.wettis.chat.mapper.ExpertMapper;
import top.wettis.chat.pojo.DO.Expert;

import top.wettis.chat.pojo.VO.Result;
import top.wettis.chat.service.IExpertService;

import java.util.List;

@Service
@Slf4j
public class IExpertServiceImpl extends ServiceImpl<ExpertMapper, Expert> implements IExpertService {

    @Override
    public List<Expert> expertPage(String expertName) {
        LambdaQueryWrapper<Expert> expertLambdaQueryWrapper = new LambdaQueryWrapper<>();
        expertLambdaQueryWrapper.like(Strings.isNotEmpty(expertName), Expert::getExpertName, expertName);
        return this.list(expertLambdaQueryWrapper);
    }
}
